//
//  SWTask.swift
//  YiyaPuzzleDemo
//
//  Created by linhan on 16/10/8.
//  Copyright © 2016年 test. All rights reserved.
//

import Foundation

extension SWDownloadTask
{
    convenience init(url:String)
    {
        self.init()
        remoteURL = url
        relativePath = SWDownloadManager.sharedManager().fetchRelativePath(url)
        localPath = SWDownloadManager.sharedManager().fetchStorePath(url:url)
    }
}

extension SWGenerationTask
{
    convenience init(page:SWPage)
    {
        self.init()
        self.page = page
        previewRelativePath = SWPageManager.sharedManager().fetchRelativePath(page, level: .preview)
    }
}

extension SWUploadTask
{
    convenience init(page:SWPage)
    {
        self.init()
        pageID = page.pageID
        bookID = page.bookID
    }
}

